Skip to content

Refactor Tests#413

Draft
danielchrist0pher wants to merge 4 commits intomainfrom
refactor-e2e-tests
Draft

Refactor Tests#413
danielchrist0pher wants to merge 4 commits intomainfrom
refactor-e2e-tests

Conversation

@danielchrist0pher
Copy link
Copy Markdown
Member

@danielchrist0pher danielchrist0pher commented Apr 13, 2026

  • Unit (test/unit.js) - no DHT / swarm
  • Integration (test/integration.js) - replication without Hyperswarm.
  • E2E (test/e2e.js) - uses Hyperswarm + hyperdht testnet

@danielchrist0pher
Copy link
Copy Markdown
Member Author

Got a base going - now going to refactor tests to use direct replication rather than hyperswarm.

@danielchrist0pher
Copy link
Copy Markdown
Member Author

Tests are refactored to use direct replication where possible. We do have one E2E test using hyperswarm - not sure this warrants its own dedicated "e2e" file. But nice to have, in case we want to grow the suite.

Comment thread test/helpers.js Outdated
return b4a.concat(chunks)
}

async function replicate(drive, swarm, mirror) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be renamed something to do with swarming, maybe event just swarm().

Comment thread test/helpers.js Outdated
while (drive.db.core.length < length) await once(drive.db.core, 'append')
}

function pipeReplicate(drive, mirror) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread test/replication.js
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these tests are unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants